<template>
	<view class="mineBox">
		 
		<view class="navBox">
			<image src="/static/pages/index/bgImg.png" class="bgImg" mode=""></image>
			<view class="navBox1">
				
				<view class="navImg">
					<image :src="obj.avatar" class="tx" mode=""></image>
				</view>
				<view class="nickName">
					{{obj.nickname}}
				</view>
			</view>
		</view>
		<!-- 数据 -->
		<view class="dataBox">
					
			<view class="dataContent">
				
				<view class="dataBox1" @click="jumpClick(3)">
					<view class="dataBox1Num">
						<image src="/static/pages/index/registration.png" class="registration" mode=""></image>
					</view>
					<view class="dataBox1W">
						活动报名审核
					</view>
				</view>
				<view class="dataBox1" @click="jumpClick(4)">
					<view class="dataBox1Num">
						<image src="/static/pages/my/iocn_Data%20view@2x.png" class="registration" mode=""></image>
					</view>
					<view class="dataBox1W">
						活动数据查看
					</view>
				</view>
				<view class="dataBox1" @click="jumpClick(5)">
					<view class="dataBox1Num">
						<image src="/static/pages/my/icon_Feedback%20data@2x.png" class="registration" mode=""></image>
					</view>
					<view class="dataBox1W">
						反馈数据
					</view>
				</view>
				
			</view>
			<view class="dataContent">
				
			<!-- 	<view class="dataBox1" @click="jumpClick(6)">
					<view class="dataBox1Num">
						<image src="/static/pages/my/icon_Customer%20data@2x.png" class="registration" mode=""></image>
					</view>
					<view class="dataBox1W">
						客户数据
					</view>
				</view> -->
				<view class="dataBox1" @click="jumpClick(7)">
					<view class="dataBox1Num">
						<image src="/static/pages/my/icon_Sales%20data@2x.png" class="registration" mode=""></image>
					</view>
					<view class="dataBox1W">
						店铺数据
					</view>
				</view>
				<view class="dataBox1" @click="jumpClick(8)">
					<view class="dataBox1Num">
						<image src="/static/pages/index/icon_change_password.png" class="registration" mode=""></image>
					</view>
					<view class="dataBox1W">
						修改登录密码
					</view>
				</view>
				<view class="dataBox1" @click="jumpClick(9)" style="margin-right: 5%;">
					<view class="dataBox1Num">
						<image src="/static/pages/index/icon_bindingwechat.png" class="registration" mode=""></image>
					</view>
					<view class="dataBox1W">
						绑定微信号
					</view>
				</view>
			</view>
			<view class="dataContent" style="justify-content: inherit;">
			
				<view class="dataBox1" @click="jumpClick(10)">
					<view class="dataBox1Num">
						<image src="/static/pages/index/icon_setup.png" class="registration" mode=""></image>
					</view>
					<view class="dataBox1W">
						设置
					</view>
				</view>
				
			</view>
		</view>
		<dibudao indexs='4'></dibudao>
	</view>
</template>

<script>
	import {wechatbind} from '@/request/api.js';
	export default {

		data() {
			return {
				obj:{}
			};
		},
		onLoad() {
			this.obj= uni.getStorageSync('regionMessage');
			this.obj.avatar='https://dy.nuofenggr.com'+this.obj.avatar
		},
		onShow() {
			
		},
		methods:{
			jumpClick(type){
				// type=1 =>客户数据页面 
				// type=2 =>销售数据页面
				// type=3 =>活动信息
				// type=4 =>修改登录密码
				// type=5 =>绑定微信号
				// type=6 =>设置
				if(type==1){
					uni.navigateTo({
						url:'/pagesA/DLR/customerData'
					})
				}
				if(type==2){
					uni.navigateTo({
						url:'/pagesA/DLR/salesData'
					})
				}
				if(type==3){
					uni.navigateTo({
						url:'baoming_shenhe'
					})
				}
				if(type==4){
					uni.navigateTo({
						url:'shuju_chakan'
					})
				}
				if(type==5){
					//绑定微信号
					uni.navigateTo({
						url:'fankui_list'
					})
				}
				if(type==6){
					
					uni.navigateTo({
						url:'kehu_shu'
					})
				}
				if(type==7){
					
					uni.navigateTo({
						url:'xiaoshou_shuju'
					})
				}
				if(type==8){
					
					uni.navigateTo({
						url:'gaimi'
					})
				}
				if(type==9){
					wx.getUserProfile({
						desc: '用于完善会员资料', // 声明获取用户个人信息后的用途，后续会展示在弹窗中，请谨慎填写
						success: infoRes => {
							wx.login({
								success(res) {
									
									console.log(res.code,'11111111111111')
									let data = {
										code:res.code,
										apptype:'miniapp',
										user_type:'1',
										user_id:uni.getStorageSync('regionMessage').id
									}
									wechatbind(data).then(ress=>{
										console.log(ress)
										if(ress.code==1){
											uni.showToast({
												title:ress.msg,
												icon:"none"
											})
										}else{
											uni.showToast({
												title:ress.msg,
												icon:"none"
											})
										}
									})
								}
							});
						}
					});
					
				}
				if(type==10){
					
					uni.navigateTo({
						url:'user/user'
					})
				}
			}
		}
	}
</script>

<style lang="scss">
	.title{
		height: 88rpx;
		line-height: 88rpx;
		text-align: center;
		width: 100%;
		position: fixed;
		top: 0;
		z-index: 999;
		background: #fff;
		margin-top: var(--status-bar-height);
	}
	page {
		background-color: #FFFFFF;
	}

	.mineBox {
		width: 100%;
		box-sizing: border-box;
		padding-bottom: 40rpx;
		.navBox{
			width: 100%;
			height: 400rpx;
			position: relative;
			.bgImg{
				width: 100%;
				height: 100%;
			}
			.navBox1{
				width: 100%;
				height: 100%;
				position: absolute;
				// top: calc(var(--status-bar-height) + 10rpx);
				top: 0;
				left: 0;
				overflow: hidden;
				.title{
					width: 100%;
					font-size: 40rpx;
					font-family: PingFang SC;
					font-weight: 500;
					text-align: center;
					margin-top: calc(var(--status-bar-height) + 20rpx);
					color: #FFFFFF;
				}
				.navImg{
					width: 100%;
					display: flex;
					justify-content: space-around;
					margin-top: 55rpx;
					.tx{
						width: 100rpx;
						height: 100rpx;
						border-radius: 50%;
					}
				}
				.nickName{
					font-size: 36rpx;
					font-family: PingFang SC;
					font-weight: 500;
					color: #FEFEFE;
					text-align: center;
					margin-top: 24rpx;
				}
			}
		}
		.dataBox{
			width: 100%;
			// height: 200rpx;
			background-color: #FFFFFF;
			// margin: -50rpx auto 0;
			position: relative;
			z-index: 99;
			box-shadow: 0px 4rpx 6rpx 0rpx rgba(218, 219, 222, 0.3);
			border-radius: 16rpx;
			
			.dataNav{
				width: 100%;
				display: flex;
				justify-content: space-around;
				.dataBox1{
					width: 50%;
					overflow: hidden;
					.dataBox1Num{
						font-size: 48rpx;
						font-family: PingFang SC;
						font-weight: 500;
						color: #303133;
						margin-top: 54rpx;
						text-align: center;
					}
					.dataBox1W{
						font-size: 36rpx;
						font-family: PingFang SC;
						font-weight: 500;
						color: #303133;
						margin-top: 36rpx;
						text-align: center;
					}
				}
			}	
			.dataContent{
				width: 100%;
				display: flex;
				justify-content: space-around;
				margin-top: 40rpx;
				box-sizing: border-box;
				padding: 0 20rpx;
				.dataBox1{
					width: 30%;
					background: #FFFFFF;
					box-shadow: 0px 0px 10px 0px rgba(211, 213, 220, 0.4);
					border-radius: 8px;
					padding: 30rpx 0;
					overflow: hidden;
					.dataBox1Num{
						width: 68rpx;
						height: 68rpx;
						margin: 0 auto;
						.registration{
							width: 100%;
							height: 100%;
						}
					}
					.dataBox1W{
						font-size: 28rpx;
						font-family: PingFang SC;
						font-weight: 500;
						color: #303133;
						margin-top: 31rpx;
						text-align: center;
					}
				}
			}
			.dataContent1{
				width: 100%;
				display: flex;
				justify-content: space-between;
				margin-top: 213rpx;
				.dataBox1{
					overflow: hidden;
					width: 50%;
					.dataBox1Num{
						width: 68rpx;
						height: 68rpx;
						margin: 0 auto;
						.registration{
							width: 100%;
							height: 100%;
						}
					}
					.dataBox1W{
						font-size: 28rpx;
						font-family: PingFang SC;
						font-weight: 500;
						color: #303133;
						margin-top: 31rpx;
						text-align: center;
					}
				}
			}
			
		}
	}
</style>
